import { HttpParams } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { PaginationList } from '../model/message';
import { ProductAttribute } from '../model/productAttr';
import { CommonApi } from './commonApi';
import { RequestService } from './request.service';

@Injectable({
  providedIn: 'root'
})
export class ProductAttrApiService extends CommonApi<ProductAttribute>{
  constructor(
    private request: RequestService,
  ) {
    super(request, '/productAttribute')
  }

  public listByCid(cid: number, params: HttpParams): Observable<PaginationList<ProductAttribute>> {
    const url = this.baseUrl + '/list/' + cid;
    return this.request.get(url, params);
  }
}
